Map indicates the layout of the F1 generation resulting from a cross between EC201 and EC103 parents. Column 1 is approximately lengthways facing north.
“Map of F1 Trees”
Diagram indicates the areas of leaf collection regarding height. Each Tree had 10 leaves collected, 3 from Low, 4 from Mid and 3 from High. The first leaf sampled was measured twice for replication comparison.
“Diagram of leaf collection levels”
“Full.xlsx” contains measurement information from sampling with the Dualex (https://www.force-a.com/en/capteurs-optiques-optical-sensors/dualex-scientific-chlorophyll-meter/), including;
Surface content of chlorophyll in ?g/cm? (Chl)
The index of epidermal flavanols (Flav)
Nitrogen Balance Index status (NBI)
Epidermal Anthocyanins (Anth).
It also contains information about the block position, the leaf height information, and presense or absence of flowering
Sheet “Dup” contains only the samples that were replicated.
# Import Data Measures
Data <-read.xlsx("Full.xlsx", sheetName ="Full")
head(Data)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1 4 CG 0 0 0 20 OG CG N
## 2 4 CG 0 0 0 20 OG CG N
## 3 4 CG 0 0 0 20 OG CG N
## 4 4 CG 0 0 0 20 OG CG N
## 5 4 CG 0 0 0 20 OG CG N
## 6 4 CG 0 0 0 20 OG CG N
## measure Height Flower Chl Flav Anth NBI
## 1 9 H Y 28.220 2.418 0.205 11.67
## 2 3 L Y 27.958 2.298 0.691 12.17
## 3 11 H Y 33.727 2.458 0.527 13.72
## 4 4 L Y 25.938 1.758 0.172 14.76
## 5 10 H Y 36.205 2.283 0.270 15.86
## 6 6 M Y 34.332 2.115 0.150 16.23
# Import Replicate Data
Dup <-read.xlsx("Full.xlsx", sheetName ="Dup")
head(Dup)
## Collection.Day group Group.ID Tree.ID Rep. measure Height Chl Flav
## 1 2.0 23 60 IN4DV Y1 1 L 1.916 2.363
## 2 1.5 3 1 IN4BT Y1 1 L 3.124 2.300
## 3 2.0 17 54 IN4DL Y2 2 L 3.414 1.826
## 4 1.5 32 28 IN4CP Y2 2 L 4.097 1.943
## 5 2.0 9 46 IN4DC Y1 1 L 4.909 1.928
## 6 1.5 5 3 IN4BW Y1 1 L 4.924 1.848
## Anth NBI
## 1 0.174 0.81
## 2 0.191 1.36
## 3 0.112 1.87
## 4 0.051 2.11
## 5 0.103 2.55
## 6 0.165 2.66
#Isolate Crimson Glory Outgroup
CG = Data[c(1:11),]
head(CG)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1 4 CG 0 0 0 20 OG CG N
## 2 4 CG 0 0 0 20 OG CG N
## 3 4 CG 0 0 0 20 OG CG N
## 4 4 CG 0 0 0 20 OG CG N
## 5 4 CG 0 0 0 20 OG CG N
## 6 4 CG 0 0 0 20 OG CG N
## measure Height Flower Chl Flav Anth NBI
## 1 9 H Y 28.220 2.418 0.205 11.67
## 2 3 L Y 27.958 2.298 0.691 12.17
## 3 11 H Y 33.727 2.458 0.527 13.72
## 4 4 L Y 25.938 1.758 0.172 14.76
## 5 10 H Y 36.205 2.283 0.270 15.86
## 6 6 M Y 34.332 2.115 0.150 16.23
#Isolate East Cape 201 Parent
EC201 = Data[c(12:21),]
head(EC201)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 12 4 EC201 0 0 0 18 P1 EC201 N
## 13 4 EC201 0 0 0 18 P1 EC201 N
## 14 4 EC201 0 0 0 18 P1 EC201 N
## 15 4 EC201 0 0 0 18 P1 EC201 N
## 16 4 EC201 0 0 0 18 P1 EC201 N
## 17 4 EC201 0 0 0 18 P1 EC201 N
## measure Height Flower Chl Flav Anth NBI
## 12 9 H Y 30.722 2.138 0.156 14.37
## 13 6 M Y 45.272 1.861 0.075 24.33
## 14 10 H Y 46.174 1.868 0.052 24.72
## 15 8 M Y 57.480 1.897 0.037 30.30
## 16 5 M Y 57.752 1.681 0.125 34.35
## 17 3 L Y 54.927 1.592 0.061 34.50
#Isolate East Cape 103 Parent
EC103 = Data[c(22:33),]
head(EC103)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 22 4 EC103 0 0 0 19 P2 EC103 N
## 23 4 EC103 0 0 0 19 P2 EC103 N
## 24 4 EC103 0 0 0 19 P2 EC103 N
## 25 4 EC103 0 0 0 19 P2 EC103 N
## 26 4 EC103 0 0 0 19 P2 EC103 N
## 27 4 EC103 0 0 0 19 P2 EC103 N
## measure Height Flower Chl Flav Anth NBI
## 22 8 M Y 31.471 1.324 0.018 23.77
## 23 11 H Y 57.349 2.111 0.053 27.17
## 24 4 L Y 43.949 1.478 0.004 29.73
## 25 12 H Y 56.779 1.846 0.108 30.75
## 26 9 M Y 55.916 1.746 0.055 32.03
## 27 10 H Y 57.809 1.746 0.054 33.11
#Isolate Offspring from the Parental Cross
F1 = Data[c(34:1825),]
head(F1)
## Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 34 1 F1 1 1 1 15 1 IN4BT N
## 35 1 F1 1 1 1 15 1 IN4BT N
## 36 1 F1 1 1 1 15 1 IN4BT N
## 37 1 F1 1 1 1 15 1 IN4BT N
## 38 1 F1 1 1 1 15 1 IN4BT N
## 39 1 F1 1 1 1 15 1 IN4BT Y1
## measure Height Flower Chl Flav Anth NBI
## 34 8 M N 3.268 1.958 0.143 1.67
## 35 2 L N 23.326 2.581 0.065 9.04
## 36 11 M N 24.682 2.265 0.112 10.90
## 37 7 M N 27.068 2.229 0.084 12.14
## 38 14 H N 27.459 2.135 0.138 12.86
## 39 3 L N 34.592 2.583 0.048 13.39
Replicates were taken by measuring a leaf sample of each tree twice, in order to establish consistency and reliability of measurements with the Dualex.
#Anthocyanin Mean
AMR = mean(Dup$Anth);AMR
## [1] 0.09799367
#Chlorophyll Mean
CMR = mean(Dup$Chl);CMR
## [1] 35.7627
#Flavanoid Mean
FMR = mean(Dup$Flav);FMR
## [1] 1.967206
#NBI Mean
NMR = mean(Dup$NBI);NMR
## [1] 18.73399
#Boxplot Anthocyanin Replicates
RAnth <- ggplot(Dup) + aes(x = Rep., y = Anth) + geom_boxplot() +geom_hline(yintercept = AMR, color = "purple4") + ylab("Anthocyanin Content") + xlab("Leaf Replicate Number") + ggtitle("Anthocyanin Measurements of Two Replicate Groups") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Chlorophyll Replicates
RChl<- ggplot(Dup) + aes(x = Rep., y = Chl) + geom_boxplot(colour = "darkorchid", fill = "plum") +geom_hline(yintercept = CMR, color = "darkorchid") + ylab("Chlorophyll g/cm") + xlab("Replicate Number") + ggtitle("Comparison of Chlorophyll levels of two replicate groups") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Flavnol Replicates
RFlav <- ggplot(Dup) + aes(x = Rep., y = Flav) + geom_boxplot() +geom_hline(yintercept = FMR, color = "purple4") + ylab("Flavanold Content") + xlab("Leaf Replicate Number") + ggtitle("Flavonoid Measurements of Two Replicate Groups") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot NBI Replicates
RNBI <- ggplot(Dup) + aes(x = Rep., y = NBI) + geom_boxplot() +geom_hline(yintercept = NMR, color = "purple4") + ylab("Nitrogen Balance Index") + xlab("Leaf Replicate Number") + ggtitle("Nitrogen Balance Index of Two Replicate Groups") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Display Boxplots
grid.arrange(RChl,RNBI,RAnth,RFlav, ncol = 2)
#Chlorophyll Anova
mod <-lm(Dup$Chl ~ Dup$Rep.)
anova(mod)
## Analysis of Variance Table
##
## Response: Dup$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 218 218.33 1.033 0.3102
## Residuals 314 66366 211.36
#Flavanol Anova
mod2 <-lm(Dup$Flav ~ Dup$Rep.)
anova(mod2)
## Analysis of Variance Table
##
## Response: Dup$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 0.0521 0.052129 0.6506 0.4205
## Residuals 314 25.1596 0.080126
#Anthocyanin Anova
mod3 <-lm(Dup$Anth ~ Dup$Rep.)
anova(mod3)
## Analysis of Variance Table
##
## Response: Dup$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 0.00003 0.0000304 0.0151 0.9023
## Residuals 314 0.63303 0.0020160
#NBI Anova
mod4 <-lm(Dup$NBI ~ Dup$Rep.)
anova(mod4)
## Analysis of Variance Table
##
## Response: Dup$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep. 1 82.5 82.530 1.115 0.2918
## Residuals 314 23241.0 74.016
The absence of statistically significant results indicates that our replicates are likely to be consistent.
Allocation refers to which group measurements were taken from, i.e. A Parental Tree (EC103 or EC201), Outgroup Tree (CG), Parental Offspring (F1)
#Anthocyanin Mean
AMA = mean(Data$Anth);AMA
## [1] 0.09772877
#Chlorophyll Mean
CMA = mean(Data$Chl);CMA
## [1] 35.21443
#Flavanol Mean
FMA = mean(Data$Flav);FMA
## [1] 1.964405
#NBI Mean
NMA = mean(Data$NBI);NMA
## [1] 18.34807
#Boxplot Anthocyanin Replicates
AAnth <- ggplot(Data) + aes(x = Allocation, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMA, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Allocation") + ggtitle("Anthocyanin of Tree Allocation") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Chlorophyll Replicates
AChl <- ggplot(Data) + aes(x = Allocation, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMA, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Allocation") + ggtitle("Chlorophyll of Tree Allocation") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Flavanol Replicates
AFlav <- ggplot(Data) + aes(x = Allocation, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMA, color = "purple4") + ylab("Flavanol Measure") + xlab("Allocation") + ggtitle("Flavonol of Tree Allocation") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot NBI Replicates
ANBI <- ggplot(Data) + aes(x = Allocation, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMA, color = "purple4") + ylab("NBI Measure") + xlab("Allocation") + ggtitle("NBI of Tree Allocation") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Display Plots
grid.arrange(AAnth,AChl,AFlav,ANBI, ncol=2)
#Chlorophyll
mod5 <-lm(Data$Chl ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
##
## Response: Data$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 6742 2247.21 9.9149 1.748e-06 ***
## Residuals 1821 412728 226.65
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
mod6 <-lm(Data$NBI ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
##
## Response: Data$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 6742 2247.21 9.9149 1.748e-06 ***
## Residuals 1821 412728 226.65
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanol
mod7 <-lm(Data$Flav ~ Data$Allocation)
anova(mod7)
## Analysis of Variance Table
##
## Response: Data$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 2.713 0.90423 14.755 1.708e-09 ***
## Residuals 1821 111.598 0.06128
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
mod8 <-lm(Data$Anth ~ Data$Allocation)
anova(mod8)
## Analysis of Variance Table
##
## Response: Data$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## Data$Allocation 3 0.3040 0.101343 47.474 < 2.2e-16 ***
## Residuals 1821 3.8873 0.002135
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Binding parents into single dataset
Parent <- rbind(EC201,EC103)
#Anthocyanin Mean
AMP = mean(Parent$Anth)
#Anthocyanin Boxplot
PAnth <- ggplot(Parent) + aes(x = Tree.ID, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMP, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of Parent Trees") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Anthocyanin histogram
PHAnth <- ggplot(Parent) + aes(x = Anth) + geom_histogram()
#Anthocyanin Display plots
grid.arrange(PAnth, PHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$Anth ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Anth by Parent$Tree.ID
## t = -1.2283, df = 19.107, p-value = 0.2342
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.05154327 0.01340994
## sample estimates:
## mean in group EC103 mean in group EC201
## 0.05883333 0.07790000
#Chlorophyll Mean
CMP = mean(Parent$Chl)
#Chlorophyll Boxplot
PChl <- ggplot(Parent) + aes(x = Tree.ID, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMP, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Tree ID") + ggtitle("Chlorophyll of Parent Trees") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Chlorophyll histogram
PHChl <- ggplot(Parent) + aes(x = Chl) + geom_histogram()
#Anthocyanin Display plots
grid.arrange(PChl, PHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$Chl ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Chl by Parent$Tree.ID
## t = -0.003842, df = 17.804, p-value = 0.997
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -7.830954 7.802387
## sample estimates:
## mean in group EC103 mean in group EC201
## 52.59242 52.60670
#Flavonol Mean
FMP = mean(Parent$Flav)
#Anthocyanin Boxplot
PFlav <- ggplot(Parent) + aes(x = Tree.ID, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMP, color = "purple4") + ylab("Flavanol Measure") + xlab("Tree ID") + ggtitle("Flavonol of Parent Trees") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Anthocyanin histogram
PHFlav <- ggplot(Parent) + aes(x = Flav) + geom_histogram()
#Anthocyanin Display plots
grid.arrange(PFlav, PHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$Flav ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$Flav by Parent$Tree.ID
## t = -1.141, df = 19.612, p-value = 0.2676
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.31409194 0.09215861
## sample estimates:
## mean in group EC103 mean in group EC201
## 1.599833 1.710800
#NBI Mean
NMP = mean(Parent$NBI)
#NBI Boxplot
PNBI <- ggplot(Parent) + aes(x = Tree.ID, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMP, color = "purple4") + ylab("NBI Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of Parent Trees") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#NBI histogram
PHNBI <- ggplot(Parent) + aes(x = NBI) + geom_histogram()
#Anthocyanin Display plots
grid.arrange(PNBI, PHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin T.test
t.test(Parent$NBI ~ Parent$Tree.ID)
##
## Welch Two Sample t-test
##
## data: Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -5.076667 7.987334
## sample estimates:
## mean in group EC103 mean in group EC201
## 33.14333 31.68800
Investigating measures across the F1 cross population
#Grouping F1 Measures By Tree
F12 <-group_by(F1,Tree.ID)
F12 <- summarise(F12,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
View(F12)
#Anthocyanin Mean
AMF = mean(F12$Anth);AMF
## [1] 0.09699261
#Chlorophyll Mean
CMF = mean(F12$Chl);CMF
## [1] 35.13564
#Flavanol Mean
FMF = mean(F12$Flav);FMF
## [1] 1.965265
#NBI Mean
NMF = mean(F12$NBI); NMF
## [1] 18.27171
#Boxplot Anthocyanin F1
FAnth <- ggplot(F1) + aes(x = Tree.ID, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMF, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Tree ID") + ggtitle("Anthocyanin of F1 population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Anthocyanin Distribution
FHAnth <- ggplot(F12) + aes(x = Anth) + geom_histogram()
#Display Anthocyanin Plots
grid.arrange(FAnth,FHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
FAA = lm(F1$Anth ~ F1$Tree.ID)
anova(FAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 0.5253 0.0033247 1.8093 2.001e-08 ***
## Residuals 1633 3.0007 0.0018376
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Chlorophyll F1
FChl <- ggplot(F1) + aes(x = Tree.ID, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMF, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Tree ID") + ggtitle("Chlorophyll of F1 Population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Chlorophyll
FHChl <- ggplot(F12) + aes(x = Chl) + geom_histogram()
#Display Chlorophyll Plots
grid.arrange(FChl, FHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Chlorophyll ANOVA
FCA = lm(F1$Chl ~ F1$Tree.ID)
anova(FCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 47130 298.29 1.3395 0.004474 **
## Residuals 1633 363634 222.68
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
FFlav <- ggplot(F1) + aes(x = Tree.ID, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMF, color = "purple4") + ylab("Flavanol Measure") + xlab("Tree ID") + ggtitle("Flavonol of F1 Population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Flavonol
FHFlav <- ggplot(F12) + aes(x = Flav) + geom_histogram()
#Display Chlorophyll Plots
grid.arrange(FFlav, FHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Flavonol ANOVA
FFA = lm(F1$Flav ~ F1$Tree.ID)
anova(FFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 25.118 0.15897 3.0531 < 2.2e-16 ***
## Residuals 1633 85.030 0.05207
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
FNBI <- ggplot(F1) + aes(x = Tree.ID, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMF, color = "purple4") + ylab("NBI Measure") + xlab("Tree ID") + ggtitle("NBI of F1 Population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of NBI
FHNBI <- ggplot(F1) + aes(x = NBI) + geom_histogram()
#Display NBI Plots
grid.arrange(FNBI, FHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#NBI ANOVA
FNA = lm(F1$NBI ~ F1$Tree.ID)
anova(FNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 16378 103.661 1.5147 8.435e-05 ***
## Residuals 1633 111761 68.439
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Anthocyanin Height
HAnth <- ggplot(F1) + aes(x = Height, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMF, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Height") + ggtitle("Anthocyanin of F1 population by Height") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Chlorophyll F1
HChl <- ggplot(F1) + aes(x = Height, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMF, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Height") + ggtitle("Chlorophyll of F1 Population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot Flavanol F1
HFlav <- ggplot(F1) + aes(x = Height, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMF, color = "purple4") + ylab("Flavanol Measure") + xlab("Height") + ggtitle("Flavonol of F1 Population by Height") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Boxplot NBI F1
HNBI <- ggplot(F1) + aes(x = Height, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMF, color = "purple4") + ylab("NBI Measure") + xlab("Height") + ggtitle("NBI of F1 Population") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
grid.arrange(HAnth,HChl,HFlav,HNBI)
#Anthocyanin ANOVA
HAA = lm(F1$Anth ~ F1$Height)
anova(HAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.0526 0.0262759 13.533 1.468e-06 ***
## Residuals 1789 3.4735 0.0019416
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Chlorophyll ANOVA
HCA = lm(F1$Chl ~ F1$Height)
anova(FCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Tree.ID 158 47130 298.29 1.3395 0.004474 **
## Residuals 1633 363634 222.68
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavonol ANOVA
HFA = lm(F1$Flav ~ F1$Height)
anova(HFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.915 0.45758 7.4943 0.0005739 ***
## Residuals 1789 109.232 0.06106
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#NBI ANOVA
HNA = lm(F1$NBI ~ F1$Height)
anova(HNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 100 50.044 0.6992 0.4971
## Residuals 1789 128039 71.570
#Grouping data by ROw
F1R = group_by(F1,Row)
F1R = summarise(F1R,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
#Boxplot Anthocyanin Height
RoAnth <- ggplot(F1) + aes(x = Row, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMF, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Row") + ggtitle("Anthocyanin of F1 population by Row") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Anthocyanin
RoHAnth <- ggplot(F1R) + aes(x = Anth) + geom_histogram()
#Display plots
grid.arrange(RoAnth,RoHAnth)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoAA = lm(F1$Anth ~ F1$Row)
anova(RoAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 0.2346 0.0047878 2.5339 4.261e-08 ***
## Residuals 1742 3.2914 0.0018895
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Chlorophyll F1
RoChl <- ggplot(F1) + aes(x = Row, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMF, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Row") + ggtitle("Chlorophyll of F1 Population by Row") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Chlorophyll
RoHChl <- ggplot(F1R) + aes(x = Chl) + geom_histogram()
#Display plots
grid.arrange(RoChl,RoHChl)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoCA = lm(F1$Chl ~ F1$Row)
anova(RoCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 21394 436.61 1.9533 0.0001046 ***
## Residuals 1742 389370 223.52
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
RoFlav <- ggplot(F1) + aes(x = Row, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMF, color = "purple4") + ylab("Flavanol Measure") + xlab("Row") + ggtitle("Flavonol of F1 Population by Row") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of Flavonol
RoHFlav <- ggplot(F1R) + aes(x = Flav) + geom_histogram()
#Display plots
grid.arrange(RoFlav,RoHFlav)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoFA = lm(F1$Flav ~ F1$Row)
anova(RoFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 8.215 0.167646 2.865 3.11e-10 ***
## Residuals 1742 101.933 0.058515
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
RoNBI <- ggplot(F1) + aes(x = Row, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMF, color = "purple4") + ylab("NBI Measure") + xlab("Row") + ggtitle("NBI of F1 Population by Row") + theme_classic();plot +stat_boxplot(notch = TRUE)
## NULL
#Histogram of NBI
RoHNBI <- ggplot(F1R) + aes(x = NBI) + geom_histogram()
#Display plots
grid.arrange(RoNBI,RoHNBI)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#Anthocyanin ANOVA
RoNA = lm(F1$NBI ~ F1$Row)
anova(RoNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 7866 160.527 2.325 8.14e-07 ***
## Residuals 1742 120273 69.043
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Making Column Values Factors
F1$Column = as.factor(F1$Column)
#Grouping data by Column
F1C = group_by(F1,Column)
F1C = summarise(F1R,Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
#Boxplot Anthocyanin Height
CAnth <- ggplot(F1) + aes(x = Column, y = Anth) + geom_boxplot() +geom_hline(yintercept = AMF, color = "purple4") + ylab("Anthocyanin Measure") + xlab("Column") + ggtitle("Anthocyanin of F1 population by Column") + theme_classic();plot +stat_boxplot(notch = TRUE);CAnth
## NULL
#Anthocyanin ANOVA
CAA = lm(F1$Anth ~ F1$Column)
anova(CAA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 0.0122 0.0040655 2.0687 0.1024
## Residuals 1788 3.5138 0.0019652
#Boxplot Chlorophyll F1
CChl <- ggplot(F1) + aes(x = Column, y = Chl) + geom_boxplot() +geom_hline(yintercept = CMF, color = "purple4") + ylab("Chlorophyll Measure") + xlab("Column") + ggtitle("Chlorophyll of F1 Population by Column") + theme_classic();plot +stat_boxplot(notch = TRUE);CChl
## NULL
#Anthocyanin ANOVA
CCA = lm(F1$Chl ~ F1$Column)
anova(CCA)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 1586 528.66 2.3101 0.07453 .
## Residuals 1788 409178 228.85
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot Flavanol F1
CFlav <- ggplot(F1) + aes(x = Column, y = Flav) + geom_boxplot() +geom_hline(yintercept = FMF, color = "purple4") + ylab("Flavanol Measure") + xlab("Column") + ggtitle("Flavonol of F1 Population by Column") + theme_classic();plot +stat_boxplot(notch = TRUE);CFlav
## NULL
#Anthocyanin ANOVA
CFA = lm(F1$Flav ~ F1$Column)
anova(CFA)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 2.305 0.76823 12.737 3.087e-08 ***
## Residuals 1788 107.843 0.06031
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Boxplot NBI F1
CNBI <- ggplot(F1) + aes(x = Column, y = NBI) + geom_boxplot() +geom_hline(yintercept = NMF, color = "purple4") + ylab("NBI Measure") + xlab("Column") + ggtitle("NBI of F1 Population by Column") + theme_classic();plot +stat_boxplot(notch = TRUE);CNBI
## NULL
#Anthocyanin ANOVA
CNA = lm(F1$NBI ~ F1$Column)
anova(CNA)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Column 3 821 273.626 3.8427 0.009333 **
## Residuals 1788 127318 71.207
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AnthDoc <-read.xlsx("Anth.xlsx", sheetName = "Anth")
heatmaply(AnthDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
ChlDoc<-read.xlsx("Chl.xlsx", sheetName = "Chl")
heatmaply(ChlDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
NBIDoc<-read.xlsx("NBI.xlsx", sheetName = "NBI")
heatmaply(NBIDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
FlavDoc<-read.xlsx("Flav.xlsx", sheetName = "Flav")
heatmaply(FlavDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
#Anthocyanin
CRHA = lm(F1$Anth ~ F1$Height*F1$Column*F1$Row)
anova(CRHA)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.05255 0.0262759 14.9537 3.788e-07 ***
## F1$Column 3 0.01228 0.0040942 2.3300 0.0727244 .
## F1$Row 49 0.23127 0.0047199 2.6861 6.175e-09 ***
## F1$Height:F1$Column 6 0.02055 0.0034247 1.9490 0.0699958 .
## F1$Height:F1$Row 98 0.20024 0.0020433 1.1628 0.1394606
## F1$Column:F1$Row 106 0.28473 0.0026861 1.5287 0.0006952 ***
## F1$Height:F1$Column:F1$Row 212 0.41375 0.0019517 1.1107 0.1490621
## Residuals 1315 2.31066 0.0017572
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHA2 = lm(F1$Anth ~ F1$Height*F1$Row)
anova(CRHA2)
## Analysis of Variance Table
##
## Response: F1$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.05255 0.0262759 14.2135 7.586e-07 ***
## F1$Row 49 0.23404 0.0047763 2.5837 2.178e-08 ***
## F1$Height:F1$Row 98 0.20394 0.0020810 1.1257 0.1942
## Residuals 1642 3.03551 0.0018487
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Chlorophyll
CRHC = lm(F1$Chl ~ F1$Height*F1$Column*F1$Row)
anova(CRHC)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 853 426.30 2.0422 0.130152
## F1$Column 3 1577 525.57 2.5178 0.056677 .
## F1$Row 49 21813 445.16 2.1326 1.244e-05 ***
## F1$Height:F1$Column 6 1282 213.61 1.0233 0.408244
## F1$Height:F1$Row 98 27033 275.85 1.3215 0.022708 *
## F1$Column:F1$Row 106 24037 226.77 1.0863 0.265386
## F1$Height:F1$Column:F1$Row 212 59670 281.46 1.3484 0.001427 **
## Residuals 1315 274499 208.74
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHC2 = lm(F1$Chl ~ F1$Height*F1$Row)
anova(CRHC2)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 853 426.30 1.9372 0.14444
## F1$Row 49 21279 434.27 1.9734 8.34e-05 ***
## F1$Height:F1$Row 98 27286 278.43 1.2652 0.04464 *
## Residuals 1642 361346 220.06
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Further Remove insignificant variables
CRHC3 = lm(F1$Chl ~ F1$Row)
anova(CRHC3)
## Analysis of Variance Table
##
## Response: F1$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 21394 436.61 1.9533 0.0001046 ***
## Residuals 1742 389370 223.52
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavonol
CRHF = lm(F1$Flav ~ F1$Height*F1$Column*F1$Row)
anova(CRHF)
## Analysis of Variance Table
##
## Response: F1$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 0.915 0.45758 9.3660 9.143e-05 ***
## F1$Column 3 2.323 0.77447 15.8523 3.957e-10 ***
## F1$Row 49 8.139 0.16611 3.4001 1.213e-13 ***
## F1$Height:F1$Column 6 1.004 0.16728 3.4240 0.002334 **
## F1$Height:F1$Row 98 5.743 0.05860 1.1995 0.096365 .
## F1$Column:F1$Row 106 14.790 0.13953 2.8559 < 2.2e-16 ***
## F1$Height:F1$Column:F1$Row 212 12.988 0.06126 1.2540 0.012358 *
## Residuals 1315 64.245 0.04886
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#NBI
CRHN = lm(F1$NBI ~ F1$Height*F1$Column*F1$Row)
anova(CRHN)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Height 2 100 50.044 0.7850 0.4563286
## F1$Column 3 818 272.802 4.2793 0.0051365 **
## F1$Row 49 7816 159.511 2.5021 8.551e-08 ***
## F1$Height:F1$Column 6 792 132.004 2.0707 0.0539220 .
## F1$Height:F1$Row 98 8175 83.418 1.3085 0.0268723 *
## F1$Column:F1$Row 106 7765 73.250 1.1490 0.1510179
## F1$Height:F1$Column:F1$Row 212 18842 88.877 1.3942 0.0004396 ***
## Residuals 1315 83831 63.750
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Remove insignificant variables
CRHM2 = lm(F1$NBI ~ F1$Row*F1$Column)
anova(CRHM2)
## Analysis of Variance Table
##
## Response: F1$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## F1$Row 49 7866 160.527 2.3456 6.383e-07 ***
## F1$Column 3 789 263.021 3.8432 0.00934 **
## F1$Row:F1$Column 106 7724 72.864 1.0647 0.31303
## Residuals 1633 111761 68.439
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Select Column,Row,Height,Tree.ID,Flav,Anth
xF = F1[c(4,5,8,11,14,15)]
xF = group_by(xF, Height, Row, Column,Tree.ID)
xF = summarise(xF, Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))
#Write to excel
#write.xlsx(as.data.frame(xF), file = "xF.xlsx", sheetName = "Height", col.names = T)
#Import altered data
HDat <-read.xlsx("xF2.xlsx", sheetName ="Sheet2")
#New Anthocyanin Anova
AHA = lm(HDat$Anth ~ HDat$Height)
anova(AHA)
## Analysis of Variance Table
##
## Response: HDat$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## HDat$Height 2 0.00000 0.00000000 0 1
## Residuals 474 0.32866 0.00069338
#New Flavonol Anova
FHA = lm(HDat$Flav ~ HDat$Height)
anova(FHA)
## Analysis of Variance Table
##
## Response: HDat$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## HDat$Height 2 0.000 0.000000 0 1
## Residuals 474 12.191 0.025718
#Write height data to excel
#Select Column for Row, Column, Tree.ID, Flav, NBI
#Bas = group_by(HDat,Column,Row,Tree.ID)
#Bas = summarise(Bas, Flav = mean(Flav, na.rm = T), NBI = mean(NBI, na.rm = T), Anth = mean(Anth, na.rm = T), Chl = mean(Chl, na.rm = T))
#Write to excel
#write.xlsx(as.data.frame(Bas), file = "comp.xlsx", sheetName = "Column", col.names = T)
#Read data controlled for column and row
Fin = read.xlsx("zF2.xlsx", sheetName = "Sheet1")
#New Chl anova
LMC = lm(Fin$Chl ~ Fin$Column*Fin$Row)
anova(LMC)
## Analysis of Variance Table
##
## Response: Fin$Chl
## Df Sum Sq Mean Sq F value Pr(>F)
## Fin$Column 1 28.01 28.013 1.6288 0.2069
## Fin$Row 49 38.56 0.787 0.0458 1.0000
## Fin$Column:Fin$Row 49 1267.82 25.874 1.5045 0.0668 .
## Residuals 59 1014.68 17.198
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#New Anth anova
LMA = lm(Fin$Anth ~ Fin$Column*Fin$Row)
anova(LMA)
## Analysis of Variance Table
##
## Response: Fin$Anth
## Df Sum Sq Mean Sq F value Pr(>F)
## Fin$Column 1 0.0002260 0.00022599 1.1353 0.29098
## Fin$Row 49 0.0002914 0.00000595 0.0299 1.00000
## Fin$Column:Fin$Row 49 0.0159769 0.00032606 1.6381 0.03513 *
## Residuals 59 0.0117441 0.00019905
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#new Flav anova
LMF = lm(Fin$Flav ~ Fin$Column*Fin$Row)
anova(LMF)
## Analysis of Variance Table
##
## Response: Fin$Flav
## Df Sum Sq Mean Sq F value Pr(>F)
## Fin$Column 1 0.00280 0.0028047 0.2336 0.6307
## Fin$Row 49 0.02850 0.0005817 0.0484 1.0000
## Fin$Column:Fin$Row 49 0.57875 0.0118111 0.9835 0.5207
## Residuals 59 0.70851 0.0120087
#new NBI anova
LMN = lm(Fin$NBI ~ Fin$Column*Fin$Row)
anova(LMN)
## Analysis of Variance Table
##
## Response: Fin$NBI
## Df Sum Sq Mean Sq F value Pr(>F)
## Fin$Column 1 1.02 1.0198 0.0603 0.80691
## Fin$Row 49 421.72 8.6065 0.5087 0.99193
## Fin$Column:Fin$Row 49 1233.77 25.1789 1.4883 0.07208 .
## Residuals 59 998.18 16.9183
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1